home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / network / manageme / tcpdump-.7 / tcpdump- / tcpdump-richard-1.7 / libpcap-0.0 / configure < prev    next >
Encoding:
Text File  |  1995-04-03  |  2.4 KB  |  87 lines

  1. #!/bin/csh -f
  2. set bison
  3. set ethers
  4. set flex
  5. set gcc
  6. set irix
  7. set pcap
  8. set ranlib
  9. set solaris
  10. if ( -e /dev/bpf0 ) then
  11.     set pcap=bpf
  12. else if ( -f /usr/include/net/pfilt.h ) then
  13.     set pcap=pf
  14. else if ( -e /dev/enet ) then
  15.     set pcap=enet
  16. else if ( -e /dev/nit ) then
  17.     set pcap=snit
  18. else if ( -f /usr/include/sys/net/nit.h ) then
  19.     set pcap=nit
  20. else if ( -f /usr/include/net/raw.h ) then
  21.     set pcap=snoop        # must test for snoop before dlpi due to IRIX
  22. else if ( -f /usr/include/sys/dlpi.h ) then
  23.     set pcap=dlpi
  24. else if ( -f /usr/include/linux/if.h ) then
  25.     set pcap=linux
  26. else
  27.     echo "configure: cannot determine packet capture interface"
  28.     exit 1
  29. endif
  30. echo "configure: using $pcap packet capture interface"
  31. if (-f /bin/uname || -f /usr/bin/uname) then
  32.     set name=`uname -s | tr '[A-Z]' '[a-z]'`
  33.     set vers=`uname -r | sed -e 's/\..*//' -e 's/T1/v1/' | tr '[A-Z]' '[a-z]'`
  34.     if ( "$name" == "irix" ) set irix='-e s/^#have-irix#//'
  35.     if ( "$name$vers" == "sunos5") then
  36.         set solaris='-e s/^#have-solaris#//'
  37.         set path=($path /usr/ccs/bin)
  38.     endif
  39. endif
  40. if ( -x /usr/local/bin/flex || -x /usr/local/flex || -x /usr/bin/flex ) then
  41.     set flex='-e s/^#have-flex#//'
  42.     echo "configure: found flex executable"
  43. else
  44.     echo "configure: couldn't find flex executable; using lex"
  45. endif
  46. if ( -x /usr/local/bin/bison || -x /usr/local/bison || -x /usr/bin/bison ) then
  47.     set bison='-e s/^#have-bison#//'
  48.     echo "configure: found bison executable"
  49. else
  50.     echo "configure: couldn't find bison executable; using yacc"
  51. endif
  52. if ( ( "$flex" == "" && "$bison" != "" ) || \
  53.      ( "$flex" != "" && "$bison" == "" ) ) then
  54.     echo "configure: don't have both flex and yacc...reverting to lex/yacc"
  55.     set flex
  56.     set bison
  57. endif
  58. set libc
  59. foreach f ( /usr/lib/libc.a /lib/libc.a /usr/lib/libc_s.a )
  60.     if ( -f $f ) then
  61.         set libc=$f
  62.         break
  63.     endif
  64. end
  65. if ( "$f" == "" ) then
  66.     echo "configure: couldn't find libc"
  67. else
  68.     nm $libc | grep ether_ntoa > /dev/null
  69.     if ( $status == 0 ) then
  70.         set ethers='-e s/^#have-ethers#//'
  71.         echo "configure: found support for /etc/ethers"
  72.     endif
  73. endif
  74. if ( -x /usr/local/bin/gcc || -x /usr/local/gcc || -x /usr/bin/gcc ) then
  75.     set gcc='-e s/^#have-gcc#//'
  76. endif
  77. if ( -x /usr/bin/ranlib ) then
  78.     set ranlib='-e s/^#have-ranlib#//'
  79. endif
  80. if ( ! -f /usr/include/stdlib.h ) ln -s /dev/null stdlib.h
  81. rm -f Makefile
  82. sed -e "s/^#have-$pcap#//" $irix $solaris $flex $bison $ethers $gcc $ranlib \
  83.     Makefile.in > Makefile
  84. chmod ug+w Makefile
  85. make depend
  86. exit 0
  87.